from lxml import etree

if __name__ == '__main__':
    root = etree.Element("root")

    # root.append(etree.Element("child1"))
    # root.append(etree.Element("child2"))
    # root.append(etree.Element("child3"))

    etree.SubElement(root, "child1")
    etree.SubElement(root, "child2")
    etree.SubElement(root, "child3")

    print(etree.tostring(root))
